<template>
    <el-dialog title="查看" :visible="lookDialog" width="50%" @close="btnCancel">
        <el-form label-width="80px" ref="lookContract" :model="formData">
            <el-form-item label="阶段编码">
                <el-input v-model="formData.phaseCode"></el-input>
            </el-form-item>
            <el-form-item label="阶段名称">
                <el-input v-model="formData.phaseName"></el-input>
            </el-form-item>
            <el-form-item label="执行单据">
                <el-select
                    placeholder="请选择"
                    v-model="formData.bm_functionName"
                    @focus="getBillList"
                >
                    <el-option
                        v-for="(item, index) in functionName"
                        :key="index"
                        :label="item.label"
                        :value="item.value"
                    >
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="执行内容">
                <el-input type="textarea" v-model="formData.phaseContent"></el-input>
            </el-form-item>
            <el-form-item label="序号">
                <el-input v-model="formData.sort"></el-input>
            </el-form-item>
                <el-row>
                <el-col :span="8">
                    <el-form-item label="是否开票" prop="status">
                             <el-switch
                                style="display: block"
                                v-model="formData.isInvoice"
                                active-color="#13ce66"
                                inactive-color="#8B8B8B"
                                :active-value="1"
                                :inactive-value="0"
                                :active-text="formData.isInvoice == 1 ? '是' : '否'"
                                
                            >
                            </el-switch>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="确认收入" prop="status">
                       <el-switch
                                style="display: block"
                                v-model="formData.isIncome"
                                active-color="#13ce66"
                                inactive-color="#8B8B8B"
                                :active-value="1"
                                :inactive-value="0"
                                :active-text="formData.isIncome == 1 ? '是' : '否'"
                                
                            >
                            </el-switch>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="启用状态" prop="status">
                        <el-switch
                                style="display: block"
                                v-model="formData.State"
                                active-color="#13ce66"
                                inactive-color="#8B8B8B"
                                :active-value="1"
                                :inactive-value="0"
                                :active-text="formData.State == 1 ? '是' : '否'"
                                
                            >
                            </el-switch>
                    </el-form-item>
                </el-col>
            </el-row>
    
        </el-form>
    </el-dialog>
</template>

<script>
import { contractBillList, getBillList } from '@/api/apis/fileManagement'
export default {
    props: {
        lookDialog: {
            type: Boolean,
            default: false,
        },
    },
    data() {
        return {
            functionName: [],
            params: { page: '1', limit: '10', Sequence: 'descending', SequenceName: 'bm_id' },
            formData: {
                billid:'',
                billKindID:'',
                createPersonID:'',
                updatePersonID:'',
                isdelete:null,
                phaseCode: '',
                phaseName: '',
                bm_functionName: '',
                phaseContent: '',
                sort: '',
                isInvoice: '',
                isIncome: '',
                State: '',
            },
        }
    },
  
  
    methods: {
        //获取单据列表数据
        async getBillList() {
            const { data } = await getBillList(this.params)
            data[1].map(item => {
                let _item = {
                    value: item.bm_id,
                    label: item.bm_functionName,
                }
                this.functionName.push(_item)
            })
            // this.functionName=data[1].bm_functionName
        },
      
        //点击取消
        async btnCancel() {
            this.$emit('update:lookDialog', false)
        },
    },
}
</script>

<style>
</style>